package cn.lg.soar.database.config;

import cn.lg.soar.database.datascope.DataPermissionServiceDefault;
import cn.lg.soar.database.datascope.DataScopeAspect;
import cn.lg.soar.database.datascope.DataScopeHolder;
import cn.lg.soar.database.handler.MyMetaObjectHandler;
import cn.lg.soar.database.translate.TranslateByEntityHandler;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.context.annotation.Configuration;

/**
 * @author luguoxiang 469599794@qq.com
 * @Date: 2024/2/23 16:30
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ImportAutoConfiguration({
        DatabaseProperties.class,
        MybatisPlusConfig.class,
        MyMetaObjectHandler.class,
        TranslateByEntityHandler.class,
        DataPermissionServiceDefault.class,
        DataScopeAspect.class
})
@Configuration
public class AutoConfiguration {

    static {
        DatabaseExceptionHandleConfig.init();
        // 数据权限忽略
        DataScopeHolder.addIgnore(TranslateByEntityHandler.class);
    }

}
